﻿<%@ Register TagPrefix="ucCommon" TagName="Common" Src="../Common/Inc/Common.ascx" %>
<%@ Register TagPrefix="ucComment" TagName="Comment" Src="../Common/Inc/Comment.ascx" %>
<%@ Register TagPrefix="ucTop" TagName="Top" Src="../Common/Inc/Top.ascx" %>
<%@ Register TagPrefix="ucMenu" TagName="Menu" Src="../Common/Inc/Menu.ascx" %>
<%@ Register TagPrefix="ucTabTitle" TagName="TabTitle" Src="../Common/Inc/TabTitle.ascx" %>
<%@ Register TagPrefix="ucCopyright" TagName="Copyright" Src="../Common/Inc/Copyright.ascx" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Com1016m.aspx.cs" Inherits="Updms.Com.Com1016m" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>▒ UPDMS [Com1016m] ▒▒▒▒▒▒▒▒▒▒</title>
<ucCommon:Common id="Common" runat="server"></ucCommon:Common>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server" id="ScriptManager1" EnableScriptGlobalization="true"></asp:ScriptManager>

<table id="table_frame">
	<tr>
		<td id="top_area" colspan="2">
			<!-- Top 시작 -->
			<ucTop:Top id="Top" runat="server"></ucTop:Top>
			<!-- Top 끝 -->
		</td>
	</tr>
	<tr>
		<td id="menu_area">
			<!-- 메뉴 시작 -->
			<ucMenu:Menu id="Menu" runat="server"></ucMenu:Menu>
			<!-- 메뉴 끝 -->
		</td>
		<td id="contents_area">
			<!-- 제목 시작 -->
			<ucTabTitle:TabTitle id="TabTitle" TagPrefixs="Com1016m" runat="server"></ucTabTitle:TabTitle>
			<!-- 제목 끝 -->
			<!-- AJAX 시작 -->
			<asp:UpdatePanel ID="UpdatePanel1" runat="server">
			<Triggers>
				<asp:PostBackTrigger ControlID="ibtn_excel"/>
			</Triggers>
			<ContentTemplate>
			<!-- 버튼 시작 -->
			<div class="button_area">
				<asp:linkbutton id="ibtn_excel" Text="엑셀" runat="server" CssClass="ibtn ibtn_excel" OnClick="ibtn_excel_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_delete" Text="삭제" runat="server" CssClass="ibtn ibtn_delete" OnClientClick="return chkDelete()" OnClick="ibtn_delete_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_save" Text="저장" runat="server" CssClass="ibtn ibtn_save" OnClientClick="return chkSave()" OnClick="ibtn_save_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_search" Text="검색" runat="server" CssClass="ibtn ibtn_search" OnClick="ibtn_search_Click"></asp:linkbutton>
			</div>
			<!-- 버튼 끝 -->
			<!-- 검색 시작 -->
			<table class="table_search">
				<tr>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_search_tab_title" Text="탭제목(한글)" runat="server" /></td>
					<td class="ctl" width="22%"><asp:TextBox id="txt_search_tab_title" runat="server" Width="98%" CssClass="ib_b"></asp:TextBox></td>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_search_tab_title_eng" Text="탭제목(영문)" runat="server" /></td>
					<td class="ctl" width="22%"><asp:TextBox id="txt_search_tab_title_eng" runat="server" Width="98%" CssClass="ib_b"></asp:TextBox></td>
					<td class="ctl" width="33%"></td>
				</tr>
			</table>
			<!-- 검색 끝 -->
			<!-- 디테일 시작 -->
			<table class="table_detail">
				<tr>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_tab_idx" Text="탭번호" runat="server" /></td>
					<td class="ctl" width="22%">
						<ul class="horizontal">
							<li style="width:90%;"><asp:textbox id="txt_tab_idx" runat="server" Width="98%" CssClass="ib_b req"></asp:textbox></li>
							<li style="width:6%;padding:2px 0 0 4px;"><asp:linkbutton id="lbtn_tab_title" runat="server" OnClientClick="return chkUserId()" OnClick="lbtn_tab_title_Click"><span class="sbtn sbtn_exclam" title="탭제목"></span></asp:linkbutton></li>
						</ul>
					</td>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_tab_title" Text="탭제목(한글)" runat="server" /></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_tab_title" runat="server" CssClass="ib_b req" Width="98%"></asp:textbox></td>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_tab_title_eng" Text="탭제목(영문)" runat="server" /></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_tab_title_eng" runat="server" CssClass="ib_b req" Width="98%"></asp:textbox></td>
				</tr>
				<tr>
					<td class="lbl"><asp:Literal ID="ltr_pgm_id" Text="프로그램" runat="server" /></td>
					<td class="ctl" colspan="3"><asp:DropDownList id="ddl_pgm_id" runat="server" Width="99.8%" CssClass="ddl che" style="height:21px"></asp:DropDownList></td>
					<td class="lbl"><asp:Literal ID="ltr_view_order" Text="탭순서" runat="server" /></td>
					<td class="ctl">
						<ul class="horizontal">
							<li><asp:textbox id="txt_view_order" runat="server" Width="30" CssClass="ib_read_only"></asp:textbox></li>
							<li style="width:4px;height:23px">&nbsp;</li>
							<li><asp:textbox id="txt_view_order_slider" runat="server"></asp:textbox></li>
						</ul>
					</td>
				</tr>
			</table>
			<!-- 디테일 끝 -->
			<!-- 리스트셋 시작 -->
			<table cellpadding="0" cellspacing="0" border="0" width="100%">
				<tr>
					<td>
						<!-- 검색어 시작 -->
						<div class="div_left">Keyword : <asp:label id="lbl_search_keyword" runat="server"></asp:label></div>
						<div class="div_right"><asp:checkbox id="cb_list_all" runat="server" AutoPostBack="True" OnCheckedChanged="cb_list_all_CheckedChanged" ToolTip="Show All"></asp:checkbox></div>
						<!-- 검색어 끝 -->
					</td>
				</tr>
				<tr>
					<td>
						<!-- 리스트 시작 -->
						<asp:GridView ID="GridView1" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound" OnRowCommand="GridView1_RowCommand" DataKeyNames="Seq,Pgm_Id,View_Order">
							<Columns>
								<asp:TemplateField HeaderText="&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;checkBoxCheck('GridView1');&quot;&gt;S&lt;/a&gt;">
									<ItemTemplate>
										<input id="cb_check" class="cb" type="checkbox" onclick="reverseRow('GridView1', 0);" runat="server" />
									</ItemTemplate>
									<ItemStyle HorizontalAlign="Center" Width="2%" />
								</asp:TemplateField>
								<asp:BoundField HeaderText="번호" >
									<ItemStyle HorizontalAlign="Center" Width="4%" />
								</asp:BoundField>
								<asp:BoundField DataField="Seq" HeaderText="Seq(X)" Visible="False" />
								<asp:BoundField DataField="Tab_Idx" HeaderText="탭번호" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="Tab_Title" HeaderText="탭제목(한글)" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Left" Width="16%" />
								</asp:BoundField>
								<asp:BoundField DataField="Tab_Title_Eng" HeaderText="탭제목(영문)" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Left" Width="16%" />
								</asp:BoundField>
								<asp:BoundField DataField="Pgm_Id" HeaderText="Pgm_Id(X)" Visible="False" />
								<asp:TemplateField HeaderText="프로그램">
									<ItemTemplate>
										<asp:LinkButton ID="lbtn_rc" runat="server" Text='<%# Bind("Pgm_Nm") %>'></asp:LinkButton>
									</ItemTemplate>
									<ItemStyle HorizontalAlign="Left" Width="32%" />
									<HeaderStyle CssClass="lbtn_rc" />
								</asp:TemplateField>
								<asp:BoundField DataField="View_Order" HeaderText="View_Order(X)" Visible="False" />
								<asp:BoundField HeaderText="탭순서" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="10%" />
									<HeaderStyle Font-Underline="True" />
								</asp:BoundField>
								<asp:BoundField DataField="Use_Yn" HeaderText="메뉴사용" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="8%" />
									<HeaderStyle Font-Underline="True" />
								</asp:BoundField>
								<asp:BoundField DataField="Access_Level" HeaderText="접근권한" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="6%" />
								</asp:BoundField>
							</Columns>
							<EmptyDataTemplate>
								<div id="no_data"></div>
							</EmptyDataTemplate>
						</asp:GridView>
						<!-- 리스트 끝 -->
					</td>
				</tr>
				<tr>
					<td>
						<!-- 페이징 시작 -->
						<div class="div_left">Result : <asp:label id="lbl_result_count" runat="server"></asp:label></div>
						<div class="div_right"><asp:label id="lbl_page" runat="server"></asp:label></div>
						<!-- 페이징 끝 -->
					</td>
				</tr>
			</table>
			<!-- 리스트셋 끝 -->
			<!-- 설명 시작 -->
				<ucComment:Comment id="Comment" runat="server" TagPrefixs="Com1016m"></ucComment:Comment>
			<!-- 설명 끝 -->
			<!-- 카피라이트 시작 -->
			<ucCopyright:Copyright id="Copyright" runat="server"></ucCopyright:Copyright>
			<!-- 카피라이트 끝 -->
			<!-- 히든값 시작 -->
			<div id="hdn_data">
				<asp:label id="lbl_pk" runat="server"></asp:label>
				<asp:Label id="lbl_search_flag" runat="server"></asp:Label>
				<asp:linkbutton ID="lbtn_set_view_order" runat="server" OnClick="lbtn_set_view_order_Click" />
				<asp:linkbutton ID="lbtn_set_menu_use_yn" runat="server" OnClick="lbtn_set_menu_use_yn_Click" />
				<input id="h_seq" type="hidden" name="h_seq" runat="server" />
				<input id="h_no" type="hidden" name="h_no" runat="server" />
				<input id="h_view_order" type="hidden" name="h_view_order" runat="server" />
				<input id="h_pid" type="hidden" name="h_pid" runat="server" />
				<input id="h_use_yn" type="hidden" name="h_use_yn" runat="server" />				
			</div>
			<!-- 히든값 끝 -->
			<!-- FilteredTextBoxExtender 시작 -->
			<act:FilteredTextBoxExtender ID="fte_tab_idx"
				runat="server"
				TargetControlID="txt_tab_idx"
				FilterType="Numbers">
			</act:FilteredTextBoxExtender>
			<act:SliderExtender ID="se_view_order" runat="server"
				TargetControlID="txt_view_order_slider"
				BoundControlID="txt_view_order"
				BehaviorID="ViewOrderSlider"
				EnableHandleAnimation="true"
				TooltipText="{0}"
				Length="180"
				Minimum="1"
				Maximum="5" />
			<act:FilteredTextBoxExtender ID="fte_view_order"
				runat="server"
				TargetControlID="txt_view_order"
				FilterType="Numbers">
			</act:FilteredTextBoxExtender>
			<!-- FilteredTextBoxExtender 끝 -->			
			</ContentTemplate>
			</asp:UpdatePanel>
			<!-- AJAX 끝 -->
		</td>
	</tr>
</table>

<asp:updateprogress AssociatedUpdatePanelID="UpdatePanel1" ID="updateProgress1" runat="server">
	<progresstemplate>
		<div id="progressBackgroundFilter"></div>
		<div id="processMessage">
			<div id="processing"></div>
			<img src="../Common/Images/processing_img.gif" />
		</div>
	</progresstemplate>
</asp:updateprogress>

</form>

<script type="text/javascript" language="javascript" defer="defer">
	//저장
	function chkSave() {
		var ls_temp = $F("ddl_pgm_id");
		var ls_yn = ls_temp.substr(5, 1); // [1]['Y'][Com1010m]공통코드관리

		if ($F("txt_tab_idx").blank()) {
			msgBox.alert(getMsg(MSG_ERR_012), setFocus, "txt_tab_idx");	//탭번호을 입력해주세요
			return false;
		}

		if ($F("txt_tab_title").blank()) {
			msgBox.alert(getMsg(MSG_ERR_013), setFocus, "txt_tab_title");	//탭제목을 입력해주세요
			return false;
		}
		
		if ($F("txt_tab_title_eng").blank()) {
			msgBox.alert(getMsg(MSG_ERR_013), setFocus, "txt_tab_title_eng");	//탭제목을 입력해주세요
			return false;
		}

		if ($F("ddl_pgm_id").blank()) {
			msgBox.alert(getMsg(MSG_ERR_015), setFocus, "ddl_pgm_id");	//하위프로그램만 선택해주세요
			return false;
		}

		if($F("h_no") == "" && ls_yn == "Y") {	//처음 저장이고 등록여부가 'Y'이면 등록불가
			msgBox.alert(getMsg(MSG_INF_002), setFocus, "ddl_pgm_id"); //이미 등록된 프로그램입니다.
			return false;
		}

		if ($F("txt_view_order").blank()) {
			msgBox.alert(getMsg(MSG_ERR_014), setFocus, "txt_view_order");	//탭순서를 입력해주세요
			return false;
		}

		var pk = $get("lbl_pk").innerHTML;
		var MSG_ID = (pk == "") ? MSG_CFM_000 : MSG_CFM_028; //저장/수정
		msgBox.confirm(getMsg(MSG_ID), doSave); //저장하시겠습니까?

		return false;
	}	
	
	//삭제
	function chkDelete() {
		if(!isCheckedOnGridView("GridView1", 0)) {
			msgBox.alert(getMsg(MSG_ERR_053));	//삭제할 항목을 선택하세요
			return false;
		}
		msgBox.confirm(getMsg(MSG_CFM_015), doDelete);	//삭제하시겠습니까?프로그램의 사용여부는 Y(사용함)으로 변경됩니다
		return false;
	}

	//상위시스템 선택불가
	function chkDisableOption(obj) {
		if (obj[obj.selectedIndex].value == "") {
			msgBox.alert(getMsg(MSG_ERR_015));	//하위프로그램만 선택해주세요
			obj.selectedIndex = 0;
			return;
		}
	}
	
	//탭번호에서 엔터로 탭제목 바인딩
	function setTabInfo() {
		if (event.keyCode == 13) {
			__doPostBack('lbtn_tab_title','');
			return false;
		}
	}

	//탭순서설정(리스트에서)
	function setViewOrder(seq, idx) {
		$("h_seq").value = seq;
		$("h_view_order").value = idx;

		__doPostBack('lbtn_set_view_order','');
	}

	//메뉴사용여부설정(리스트에서)
	function setMenuUseYn(pid, use_yn) {
		$("h_pid").value = pid;
		$("h_use_yn").value = use_yn;

		__doPostBack('lbtn_set_menu_use_yn','');
	}

	//리스트 선택시 슬라이드값 설정
	function setSliderValue(v, id) {
		var sliderbehaviour = $find(id);
		if (sliderbehaviour != null) {
			sliderbehaviour.set_Value(v);
		}
	}
</script>
</body>

</html>
